
import DirectionStateMachine from '../../base/DirectionStateMachine'
import AirDeathTopState from './AirDeath/AirDeathTopState'
import AirDeathBottomState from './AirDeath/AirDeathBottomState'
import AirDeathLeftState from './AirDeath/AirDeathLeftState'
import AirDeathRightState from './AirDeath/AirDeathRightState'

const IMG_DEATH_PREFIX = 'images/death/death'

export default class AirDeathSubStateMachine extends DirectionStateMachine {
  constructor(owner, fsm) {
    super(owner, fsm)
  }

  initClass(){
    this.topClass = AirDeathTopState
    this.bottomClass = AirDeathBottomState
    this.leftClass = AirDeathLeftState
    this.rightClass = AirDeathRightState
  }

  initAnimations() {
    this.topAnimations = []
    this.bottomAnimations = []
    this.leftAnimations = []
    this.rightAnimations = []

    for (let i = 68; i <= 78; i++) {
      this.topAnimations.push(this.imageMap.get(`${IMG_DEATH_PREFIX} (${i }).png`))
    }

    for (let i = 79; i <= 89; i++) {
      this.bottomAnimations.push(this.imageMap.get(`${IMG_DEATH_PREFIX} (${i }).png`))
    }

    for (let i = 57; i <= 67; i++) {
      this.leftAnimations.push(this.imageMap.get(`${IMG_DEATH_PREFIX} (${i }).png`))
    }

    for (let i = 90; i <= 100; i++) {
      this.rightAnimations.push(this.imageMap.get(`${IMG_DEATH_PREFIX} (${i }).png`))
    }
  }
}
